<?php

namespace app\common\config\validate;


use think\Validate;

class ConfigDictionaryValidate extends Validate
{
    protected $rule = [
        'id' => ['require'],
        'title' => ['require', 'unique:config_dictionary,title'],
        'field' => ['require', 'unique:config_dictionary,field'],
        'value' => ['require']
    ];

    protected $message = [
        'id,require' => '参数错误',
        'title.require' => 'Picker名称不能为空',
        'title.unique' => 'Picker名称已经存在',
        'field.require' => 'Picker字段不能为空',
        'field.unique' => 'Picker字段已经存在',
        'value.require' => '请录入规则'
    ];

    protected $scene = [
        'edit' => ['id', 'title', 'field', 'value'],
        'create' => ['title', 'field', 'value'],
        'delete' => ['id'],
    ];
}